package com.esender.api.advice;

import com.esender.api.util.R;
import com.esender.api.vo.ResultVO;
import com.esender.common.exception.ApiException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ApiExceptionHandler {
    @ExceptionHandler(ApiException.class)
    public ResultVO handleException(ApiException e) {
        return R.error(e);
    }
}
